package org.tigris.atlas.uddi.weblogic;

import java.io.IOException;
import java.util.Properties;

import org.tigris.atlas.config.ConfigurationManager;

public class UddiProperties {

	private static Properties PROPS = null;
	private static UddiProperties INSTANCE = null;
	
	private static final String PROP_FILE = "/uddi.properties";
	private static final String UDDI_URL = "uddi.url";
	
	private UddiProperties() {
	}
		
	private static UddiProperties getInstance() {
		if( INSTANCE == null ) {
			INSTANCE = new UddiProperties();
		}
		
		return INSTANCE;
	}
	
	private Properties getProperties() throws IOException {
		if( PROPS == null ) {
			PROPS = ConfigurationManager.getConfiguration( PROP_FILE );
		}
		
		return PROPS;
	}

	public static String getUddiUrl() throws IOException {
		return (String) getInstance().getProperties().getProperty( UDDI_URL );
	}
}
